#include "HSModelAPI.h"
#include "GeometryUtils.h"

#include <utility>

class HeightMap;
class Ground;

namespace HeightMapUtils
  {
  HSMODEL_API std::pair<size_t, size_t> FindHeightMapIndexes(const TVector2 &i_point,
                                                             const TVector2 &i_origin_xz, double i_cell_size);

  HSMODEL_API std::pair<size_t, size_t> FindHeightMapIndexes(const TVector2 &i_point);

  HSMODEL_API TVector3 ConvertHMapPointToTVector(size_t i_x, size_t i_z, double i_height,
                                                 const TVector2 &i_origin_xz, double i_cell_size);

  HSMODEL_API TVector3 ConvertHMapPointToTVector(size_t i_x, size_t i_z, double i_height);

  HSMODEL_API TVector3 TransformPositionToCenterOfCell(TVector3 i_position);

  HSMODEL_API bool CellBelowTriangle(size_t i_x, size_t i_y, const TTriangle2 i_triangle);  

  HSMODEL_API void GetObjectPlacementCoords(TVector3& o_coords, const Ground& i_ground, const TVector3& i_world_point);
  } 